let dbconf = require('./config/db');
let knexObj = require('knex');

let knex = knexObj({
    client: 'mysql',
    connection: {
        host: dbconf.host,
        user: dbconf.user,
        port: dbconf.port,
        password: dbconf.password,
        database: dbconf.database
    },
    acquireConnectionTimeout: 10000
});
// knex.on('query', (queryObj)=>{
//     yog.log.notice(`knex database query: sql: ${queryObj.sql}, binding: queryObj.bindings`);
// });

let getKnex = () => {
    return knex;
}
module.exports = getKnex;
